In [1]:
import numpy as np
import McNeuron
import matplotlib.pyplot as plt
from copy import deepcopy
%matplotlib inline
#np.random.seed(0)
L_neuron = McNeuron.visualize.get_all_path("/Volumes/Arch/Projects/Computational Anatomy/pyramidal/de koninck/")
#L_neuron = McNeuron.visualize.get_all_path("/Volumes/Arch/Projects/Computational Anatomy/badea, ganglia cell, retina mouse/")
In [90]:
i = 45
n = McNeuron.Neuron(file_format = 'swc', input_file=L_neuron[i])
#inter2 = Inter2.subsample_given_n_node(400)
McNeuron.visualize.plot_2D(n, dpi = 120, size = 5, show_width= False, background = .01,line_width=2)
In [91]:
McNeuron.visualize.plot_dedrite_tree(n)
In [54]:
#n.show_features()
In [ ]:
McNeuron.visualize.plot_2D(n.subsample_given_n_node(100),size = 5)
In [ ]:
L_neuron = McNeuron.visualize.get_all_path("/Volumes/Arch/Projects/Computational Anatomy/pyramidal/de koninck/")
B = np.zeros(len(L_neuron))
for i in range(len(L_neuron)):
n = McNeuron.Neuron(file_format = 'swc', input_file=L_neuron[i])
B[i] = sum(n.branch_order[1:]==2)
print i
In [92]:
B = McNeuron.visualize.important_node_full_matrix(n)
I = np.sort(B.sum(axis=1))
(F,G) = np.unique(I, return_counts=True)
plt.plot(G)
Out[92]:
In [93]:
plt.imshow(B)
Out[93]:
In [94]:
from numpy.linalg import inv
P = np.eye(B.shape[0]) - inv(B)
plt.imshow(P)
Out[94]:
In [96]:
P.sum(axis=0)
Out[96]:
In [100]:
(ends,) = np.where(P.sum(axis=0)==2)
I = B[np.ix_(ends,ends)].sum(axis=1)
(F,G) = np.unique(I, return_counts=True)
plt.plot(G)
Out[100]:
In [66]:
B[np.ix_(ends,ends)]
Out[66]:
In [ ]: